package ioc15;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/3/7 14:51
 * Version:1.0-SNAPSHOT
 */
public class Test {

    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("ioc15/spring.xml");
        System.out.println(ac.getBean("someBean"));
//        SomeBean someBean = (SomeBean) ac.getBean("someBean");
//        SomeBean someBean2 = (SomeBean) ac.getBean("someBean2");
//        OtherBean otherBean = (OtherBean) ac.getBean("otherBean");
//        OtherBean otherBean2 = (OtherBean) ac.getBean("otherBean2");
//        System.out.println("someBean的name:"+someBean.getName());
//        System.out.println("someBean2的name:"+someBean2.getName());
//        System.out.println("otherBean的name:"+otherBean.getName());
//        System.out.println("otherBean2的name:"+otherBean2.getName());
    }

}
